package com.zekai.calculator;

import android.util.Log;

import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

public class MainViewModel extends ViewModel {
    //tag
    private static final String Tag="Calculator-MainViewModel";
    //当前表达式
    String expression="";
    //当前结果
    String result="";
    //角度弧度状态
    boolean isRad=false;
    //内存栈
    Double memory=0.0;
    Boolean isMemoryError=false;
    Boolean isMemoryEmpty=true;


    private List<String> expressions = new ArrayList<>();
    private List<String> results = new ArrayList<>();
    //构造函数
    public MainViewModel(){};
    public void addToHistory(String expression, String result) {
        expressions.add(expression);
        results.add(result);
    }

    public List<String> getExpressions() {
        return expressions;
    }

    public List<String> getResults() {
        return results;
    }
    public void setExpression(List<String> expressions){
        this.expressions=expressions;
    }
    public void setResult(List<String> results){
        this.results=results;
    }



}
